{template 'common/header'}
{template 'web/task/navs'}
<div class="panel panel-default">
    <div class="panel-heading">
        搜索
    </div>
    <div class="panel-body">
        <form action="./index.php" method="get"  class="form-horizontal">
            <input type="hidden" name="c" value="{php echo $_GPC['c']}"/>
            <input type="hidden" name="a" value="{php echo $_GPC['a']}"/>
            <input type="hidden" name="m" value="{php echo $_GPC['m']}"/>
            <input type="hidden" name="do" value="{php echo $_GPC['do']}"/>
            <input type="hidden" name="act" value="{php echo $_GPC['act']}"/>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">开始时间</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					{php echo _tpl_form_field_date('start_time',$_GPC['start_time'],true)}
					<span class="help-block"></span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">结束时间</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					{php echo _tpl_form_field_date('end_time',$_GPC['end_time'],true)}
					<span class="help-block"></span>
				</div>
			</div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-1 col-xs-12 col-sm-10 col-md-10 col-lg-11">
                    <input name="submit" type="submit" value="搜索" class="btn btn-primary span3" />
                    <input type="hidden" name="token" value="{$_W['token']}" />
                </div>
            </div>
        </form>
    </div>
</div>
<style>
	.table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {overflow: visible !important;}
	.dropdown-menu{min-width:4em;}
	.table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {white-space: normal !important;overflow: visible !important;}
	.dropdown{display:inline-block !important;}
	.account-stat-num > div {width: 25%;float: left;font-size: 16px;text-align: center;}
	.account-stat-num > div span {display: block;font-size: 30px;font-weight: bold;}
</style>
<div class="panel panel-default" style="padding:1em">
	<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin: -1em -1em 1em -1em;">
		<div class="navbar-header">
			<a class="navbar-brand" href="javascript:;">数据统计</a>
		</div>
	</nav>
	<div class="panel-body">
		<div class="account-stat-num row">
			{php $m = M('moneylog')->total();}
			<div>总金额<span>{$m['all']['fee']}</span></div>
			{if empty($_GPC['start_time'])}
			<div>本日金额<span>{$m['day']['fee']}</span></div>
			<div>本周金额<span>{$m['week']['fee']}</span></div>
			<div>本月金额<span>{$m['month']['fee']}</span></div>
			{/if}
		</div>
	</div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">
		跑腿收入记录
    </div>
    <div class="panel-body">
        <table st-table="items" class="table table-striped table-condensed" style="display:auto;">
            <thead>
            <tr>
				<th style="width:50px;">编号</th>
				<th style="width:120px;">会员昵称</th>
				<th style="width:120px;">真实姓名</th>
				<th style="width:120px;">手机号</th>
				<th style="width:100px;">金额</th>
				<th style="width:80px;">会员头像</th>
				<th style="width:13em;">订单信息</th>
				<th style="width:12em;">时间</th>
				<th>操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list['list'] $li}
            <tr>
                <td>{$li['id']}</td>
				{php $member = M('member')->getInfo($li['openid'])}
				<td>{$member['nickname']}</td>
				<td>{$member['realname']}</td>
				<td>{$member['mobile']}</td>
				<td>
				    <label class="label label-info">{$li['fee']}</label>
				</td>
				<td><img src="{php echo tomedia($member['avatar'])}" style="width:4em;height:4em;" alt=""/></td>
				{php $recive = M('recive')->getInfo($li['reciveid'])}
				{php $reciver = M('member')->getInfo($recive['openid'])}
				{php $task = M('tasks')->getInfo($recive['taskid'])}
				{php $tasker = M('member')->getInfo($task['openid'])}
				<td>
				    <label class="label label-success">发单时间：{php echo date('Y-m-d H:i',$task['create_time'])}</label>
					<label class="label label-success">接单时间：{php echo date('Y-m-d H:i',$recive['create_time'])}</label>
					<label class="label label-info">发单人：{php echo $tasker['nickname']}</label>
				</td>
				<td>
				    <label class="label label-success">{php echo date('Y-m-d H:i',$li['create_time'])}</label>
				</td>
                <td>
                    <a href="{php echo $this->createWebUrl('moneylog',array('act'=>'delete','id'=>$li['id']))}" class="btn btn-danger">删除</a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {php echo $list['pager']}
    </div>
</div>
{template 'common/footer'}